package com.aa;

public class RevStack {
private int maxSize;
private char [] stkArray;
private int top;

public RevStack(int i){
	maxSize = i;
	top = -1;
	stkArray = new char [maxSize];
}

public void push(char c){
	stkArray[++top] = c;
	}

public char pop(){
	return stkArray[top--];
}

public boolean isEmpty(){
	return (top == -1);
}

public String doRev(String s){
	String o = "";
	int stacksize = s.length();
	RevStack rs = new RevStack(stacksize);
	for (int i = 0; i < stacksize; i++){
		char c = s.charAt(i);
		rs.push(c);
	}
	while (!rs.isEmpty()){
		o = o + rs.pop();
	}
	return o;
	
}
}
